<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>确认付款</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__PUBLIC__/static/agent/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__PUBLIC__/static/agent/css/wallet.css" />
		<style type="text/css">
			.fuk_conbox{background: none; padding: 5% 2%;}
			.fuk_ctimg{width: 40%;}
			.ffuk_prinum{font-size: .9rem; margin: 1.8rem 0 .2rem;}
			#sale_price{font-size: 2rem; line-height: 35px; text-align: center; margin-top: 1.2rem;}
			.label{float: left; line-height: 35px;}
			.pay_spnum{ width: 100px; padding: 0 30px;}
			.mui-numbox [class*=btn-numbox]{width: 30px;}
		</style>
	</head>

	<body>
		<form id="my_form" class="layui-form update_form" action="{:url('shop/topay1')}" method="post">
			<input type="hidden" name="good_id" value="{$goods['id']}" />
		<div class="mui-content qrfuk_content" style="background: white;">
			<div class="fuk_conbox">
				<div class="fuk_ctop">
					<div class="fuk_ctimg" style="text-align: center;"><img id='store_thum' style="width: 100px;height:80px;" src="{$goods['thumb']}">
					<div class="fuk_spnam">{$goods['goods_name']}</div>
				</div>
				<div id="sale_price">¥{$goods['sale_price']}</div>
				<div class="ffuk_prinum clearfix" style="margin-left:25%">
					<div class="label" style="color: #8c8787;">数量：</div>
					<div class="mui-numbox pay_spnum">
						<button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
						<input class="mui-input-numbox" type="number" onchange="change(this)" id="buy_number" name="nums" value="1">
						<button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
					</div>
				</div>
				<button type="submit" class="qrfuk_btn" onclick="return check_num()" id='qrfuk_btn'>确认付款</button>
			</div>
		</div>
		<input type="hidden" name="goods_id" value="{$goods.id}">
		</form>
		<!----------------悬浮框  设置支付密码 ------------------->
		<!----------------悬浮框  填写支付密码------------------->
	</body>

</html>
<script type="text/javascript" src="__PUBLIC__/static/js/jquery.min.js"></script>
<script src="__PUBLIC__/static/js/mui.min.js"></script>
<script src="__PUBLIC__/static/layui/layui.all.js"></script>
<script>
	function change(obj){
		if($(obj).val()<=1){
			$(obj).val(1);
		}
	}
	
	function check_num(){
		var goods_num ="{$goods.stock}";
		var pay_num = $('#buy_number').val();
		if(parseInt(goods_num)<parseInt(pay_num)){
			layer.msg('库存不足');
			return false;
		}
		
	}
	
</script>